package com.supreme.nettyapp.generalserver.mqttserver;

import com.supreme.nettyapp.generalserver.mqttserver.service.MqttServerService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@Component
@ConditionalOnProperty(prefix = "netty.mqtt-server", name = "enabled", havingValue = "true")
public class MqttServerStarter {

    @Resource
    private MqttServerService mqttServerService;

    @PostConstruct
    private void mqttServerStarter() {
        mqttServerService.startNettyServer();
    }
}
